﻿using System.Web;

namespace Clover.BaseAuth
{
    public class DefaultCurrentIdentity
    {
        public string IdentityKey { get; set; } = "LoginUser";

        internal static DefaultCurrentIdentity _instance;

        public static DefaultCurrentIdentity Default {
            get => _instance ?? new DefaultCurrentIdentity();
            set => _instance = value;
        }

        public virtual string GetIdentity() {
            return HttpContext.Current.Session[IdentityKey] as string;
        }
        public virtual void SetIdentity(string Identity)
        {
            HttpContext.Current.Session[IdentityKey] = Identity;
        }
    }
}
